MaxMemoryUsed
MaxMemoryUsed[] gives the maximum number of bytes used to store all data for the current Wolfram System session.
MaxMemoryUsed[expr] gives the maximum number of bytes used during the evaluation of expr.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.